The modifiers and the modifier keys are not cleared when the layout is
rebuilt, and this may cause access to destroyed objects.
So clear them before rebuilding them again when adding the row keys.
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/work_items/9408
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4396>
(cherry picked from commit
7d8323abb81215dc96f716fd66cad42772993685)
purpose === Clutter.InputContentPurpose.ALPHA ||
purpose === Clutter.InputContentPurpose.PASSWORD ||
purpose === Clutter.InputContentPurpose.TERMINAL;
+ this._modifiers.clear();
+ this._modifierKeys.clear();
keyboardModel.getLevels().forEach(currentLevel => {
const levelLayout = new KeyContainer();